package com.ysx.user.service.impl;

import com.ysx.attendance.dao.ClassDao;
import com.ysx.user.dao.UserDao;
import com.ysx.user.service.UserService;
import com.ysx.utils.DaoFactory;

public class UserServiceImpl implements UserService {

    private UserDao userDao=null;

    {
        // 这段代码会在login之前执行
        DaoFactory<UserDao> userDaoFactory = new DaoFactory();
        userDao =userDaoFactory.getDao(UserDao.class);

    }

    @Override
    public Integer login(String phone, String password) {
        int rs =0;
        try {
            rs= userDao.login(phone,password);
        }catch (Exception e){
            // 记录日志
            System.out.println(e);
        }
        return rs;
    }
}
